home *** CD-ROM | disk | FTP | other *** search
- /* included files */
- #include "Brushes.h"
- #include "AppInterface.h"
-
- /******************
- Typedefs
- *******************/
-
- /* This structure represents each "document". The FSSpec is used to keep track of whether
- a Save command should call Save As, and if not which file to save into. The dirty
- flag is used to keep track of when saving is necessary. The world is the GWorld
- that corresponds to the window, and the scroll bars are the scroll bars */
- typedef struct
- {
- CWindowRecord window;
- GWorldPtr world;
- ControlHandle hScroll;
- ControlHandle vScroll;
- FSSpec fileSpec;
- Boolean dirty;
- }DocumentRecord, *DocumentPeek;
-
- /******************
- Various Constants
- *******************/
- /* Nifty scroll bar constants */
- #define kScrollWidth 16
- #define kScrollAdjust (kScrollWidth - 1)
- /* kScrollTweak is used to compensate for scrollBars "off by one" thang. They are
- off by one on each end, which makes it 2 */
- #define kScrollTweak 2
- #define kLineScrollAmount 8
- #define kPageScrollAmount 64
-
- #define kMinWindowSize 72 /* One inch minimum size */
- #define kPICTHeaderSize 512 /* the size of the header of a PICT file */
-
- /* Strings */
- #define kAppStringsID 128
- #define kArtStr 1
- #define kSrcPictStr 2
- #define kSrcSavePrompt 3
- #define kDstSavePrompt 4
- #define kStartPainting 5
- #define kStopPainting 6
-
- #define kErrorStringsID 129
- #define kGenericErrorStr 1
- #define kNoMemStr 2
- #define kNoBrushStr 3
- #define kNoFilterStr 4
- #define kWimpyMachineStr 5
- #define kNoResStr 6
- #define kNoUndoStr 7
- #define kNoPrinterStr 8
- #define kBadReadStr 9
- #define kBadWriteStr 10
-
- /* Menus and menu items */
- #define kNumPaintMenus 3 /* Filters, Brush, and AutoPaint */
-
- /* Indexes into the global MenuHandle array */
- #define kFilterMenu 0
- #define kBrushMenu 1
- #define kAutoPaintMenu 2
-
- /* The menu IDs and item numbers */
- #define kFilterMenuID 131
-
- #define kBrushMenuID 132
- #define iPenSize 1
- #define iConfigureBrush 3
- #define kFirstBrush 5
-
- #define kAutoPaintMenuID 133
- #define iSetup 1
- #define iStartPainting 3
-
- /* Dialog and Alert IDs */
- #define kPenDlogID 130
- #define kAutoPaintID 131
- #define kPrintingNowDlogID 132
- #define kSaveChangesDlogID 135
- #define kDepthAlertID 136
-
-
- /******************
- Prototypes
- *******************/
-
- /* Painterly.c */
- void DoFilterMenu(short item_no);
- void DoBrushMenu(short item_no);
- void DoPaintMenu(short item_no);
- Boolean SaveCurrentDocs(void);
- void SetUpAndShowWindows(void);
- void DepthAlert(short offdepth);
- OSErr ReadPICTFileToNewWorlds(FSSpec *fileSpec);
- OSErr WorldToExistingFile(FSSpec *fileSpec, GWorldPtr world);
- OSErr WorldToNewFile(FSSpec *fileSpec, GWorldPtr world);
- OSErr WriteWorldToPICTFile(FSSpec *fileSpec, GWorldPtr world);
- void PenDlog(void);
- void AutoPaintSetupDlog(void);
- void ShortToDlog(short val, DialogPtr dptr, short item);
- short DlogToShort(DialogPtr dptr, short itmnum);
- pascal void BtnItem(DialogPtr dptr, short item);
- void Print(GWorldPtr world);
- short SaveChangesDlog(void);
- void BuildFilterMenu(MenuHandle menu);
- short CallFilter(GWorldPtr world, Handle theFilter);
- void BuildBrushMenu(MenuHandle menu);
- short CallBrush(short msg, BrushParams *params, Handle theBrush);
- OSErr SetCurrentBrush(short brushNum);
-
- /* PainterlyUtils.c */
- Boolean IsAppWindow(WindowPtr wind);
- void StrokeBoth(Point pt);
- void OffToWindow(CWindowPtr wind, Rect *rect);
- void OffToOff(GWorldPtr src, GWorldPtr dst);
- void EraseOff(GWorldPtr world);
- void DrawPictOff(GWorldPtr world, PicHandle pict);
- Boolean LockWorld(GWorldPtr world);
- void UnlockWorld(GWorldPtr world);
- Boolean LockBoth(void);
- void UnlockBoth(void);
- void DoActivateUpdate(void);
- void ReadyWZoom(WindowPtr wind, short zoomDir, short maxH, short maxV);
- void KillGlobalGWorlds(void);
- Boolean InitGlobalGWorlds(Rect *frame);
- PicHandle WorldToPict(GWorldPtr world);
- void OpenClip(WindowPtr wind);
- void CloseClip(WindowPtr wind);
-
- void AdjustScrollbars(WindowPtr wind, Boolean needsResize);
- void AdjustScrollValues(WindowPtr wind);
- pascal void ScrollActionProc(ControlHandle control, short part);
- void ScrollPict(short hAmnt, short vAmnt, WindowPtr wind);
-
- void SetUpForUndo(CWindowPtr wind);
- Str255 *TheStr(Str255 str, short index);
- Str255 *PStrCat(Str255 str1, Str255 str2, Boolean addSpace);
- void PStrCopy(Str255 src, Str255 dst);
-
- void DoErrorAlert(short stringID1, short error);
-
- pascal void PictWriter(Ptr pointer, short nextHunk);
- pascal void PictReader(Ptr pointer, short nextHunk);
-
- /* PaintInit.c */
- Boolean PaintInit(void);
- void CalcWindowStats(void);
-
-
-